<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="s" uri="/struts-tags"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'modAdmin.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<!--框架必需start-->
<script type="text/javascript" src="ui/js/jquery.js"></script>
<script type="text/javascript" src="ui/js/framework.js"></script>
<script type="text/javascript" src="ui/js/Validform_v5.3.2.js"></script>
<link href="ui/css/import_basic.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" id="skin" prePath="/"/>
<link rel="stylesheet" type="text/css" id="customSkin"/>
<link href="ui/skins/blue/style.css" rel="stylesheet" type="text/css" id="theme" themeColor="blue"/>
<!--框架必需end-->
  </head>
  
  <body onload="select();">

   	<div class="box2" panelTitle="修改用户" style="margin-left: auto;margin-right: auto;float: left;width: 100%;">
		<fieldset>
			<form action="adminMod.action" method="post" class="modform">
		<table class="tableStyle" formMode="transparent" >
			<tr>
				<td>编号：</td><td><input type="text" id="id" name="admin.id" value="${admin.id}" readonly="readonly"/></td>
			</tr>
			<tr>
				<td>管理员账号:</td>
				<td><input type="text" id="adminName" name="admin.adminName" value="${admin.adminName}" datatype="s6-18" errormsg="名称至少6个字符,最多18个字符！"/></td>
				<td><div class="Validform_checktip"></div></td>				
			</tr>
			<tr>	
				<td>管理员密码:</td>
				<td><input type="password" id="password" name="admin.password" value="${admin.password}" datatype="*6-15" errormsg="密码范围在6~15位之间！"/></td>
				<td><div class="Validform_checktip"></div></td>			
			</tr>	
			<tr>	
				<td>重复管理员密码:</td>
				<td><input type="password" id="repassword" name="repassword" value="${admin.password}"  datatype="*" recheck="admin.password" errormsg="您两次输入的账号密码不一致！"/></td>
				<td><div class="Validform_checktip"></div></td>			
			</tr>	
			<tr>
				<td>电子邮箱:</td>
				<td><input type="text" id="email" name="admin.email"   value="${admin.email}" datatype="e" errormsg="邮箱格式有误！"/></td>
				<td><div class="Validform_checktip"></div></td>				
			</tr>
			<tr>	
				<td>电话:</td>
				<td><input type="text" id="phone" name="admin.phoneNumber"  value="${admin.phoneNumber}" datatype="m" errormsg="请输入11位移动电话号码！"/></td>
				<td><div class="Validform_checktip"></div></td>
			</tr>	
			<tr>	
				<td>权限:</td>
				<td>
					<select id="role" keepDefaultStyle="true" name="admin.roles">
						<option value="1">超级管理员</option>
						<option value="2" selected="selected">普通管理员</option>
					</select>
				</td>
			</tr>
			<tr  id="ms">	
				<td>管理站:</td>
								<td>
									<select id="sel-15" keepDefaultStyle="true" name="admin.managementStation.MSId" >
										<option value="${admin.managementStation.MSId }">
											 	${admin.managementStation.MSName}
											 </option>
										<s:iterator value="stations" var="st">
											 <option value="<s:property value="#st.MSId"/>">
											 	<s:property value="#st.MSName"/>
											 </option>
										</s:iterator>
									</select>
								</td>
			</tr>
			<tr>
				<td>
					<input type="submit" value="修改"/>
				</td>
				<td>
					<input type="reset" value=" 重 置 "/>
				</td>
			</tr>
		</table>
		</form>
		 </fieldset>
	</div>	
	
		<script type="text/javascript">
		$(function(){
			//$(".registerform").Validform();  //就这一行代码！;
	
			$(".modform").Validform({
				tiptype:2
			});
		});
			function select(){
			var id = $("#role").val();
			var roles = ${admin.roles};
			if(roles==1){
				$("#ms").css("visibility","hidden");
			}else{
				$("#ms").css("visibility","visible");
				}
			}
	</script>
  </body>
</html>
